/**
 * @name: pubg
 * @author: XU>.<CHEN
 * @date: 2023-03-13 15:31
 * @description：pubg接口
 * @update: 2023-03-13 15:31
 */

import { handleGet } from '@/utils/pubgAxios'

const baseApi = '/pubg_api/shards/steam'

// 获取单个玩家
export const getPlayerInfoSingle = (playerId: string) => handleGet(`${baseApi}/players/${playerId}`)
// 根据玩家名查询玩家信息 最多十名
export const getPlayerInfo = (playerKey: any, isName: boolean = true) => handleGet(`${baseApi}/players?filter[${isName ? 'playerNames' : 'playerIds'}]=${playerKey}`)
// 根据比赛ID查询比赛信息
export const getMatchesById = (matchId: any) => handleGet(`${baseApi}/matches/${matchId}`)
// 获取赛季信息
export const getAllSeasons = () => handleGet(`${baseApi}/seasons`)
// 获取玩家某赛季排位信息
export const getPlayerSeasonRanked = (playerId: string, seasonId: string) => handleGet(`${baseApi}/players/${playerId}/seasons/${seasonId}/ranked`)
// 获取玩家某赛季一般模式信息
export const getPlayerSeason = (playerId: string, seasonId: string) => handleGet(`${baseApi}/players/${playerId}/seasons/${seasonId}`)
// 获取玩家生涯统计信息
export const getPlayerLifetime = (playerId: string) => handleGet(`${baseApi}/players/${playerId}/seasons/lifetime`)
// 获取玩家在某游戏模式下的生涯统计信息
export const getPlayerLifetimeByGameMode = (playerIds: string, gameMode: string) => handleGet(`${baseApi}/seasons/lifetime/gameMode/${gameMode}/players?filter[playerIds]=${playerIds}`)
// 获取玩家武器统计数据
export const getPlayerWeaponMastery = (playerId: string) => handleGet(`${baseApi}/players/${playerId}/weapon_mastery`)
// 获取玩家生存统计数据
export const getPlayerSurvivalMastery = (playerId: string) => handleGet(`${baseApi}/players/${playerId}/survival_mastery`)
// 获取战队信息
export const getClansInfo = (clanId: string) => handleGet(`${baseApi}/clans/${clanId}`)
